package com.example.common;

public class Result<T> {
    private String name;
    private String amount;
    private String email;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getname() {
        return name;
    }

    public void setname(String name) {
        this.name = name;
    }

    public String getamount() {
        return amount;
    }

    public void setamount(String amount) {
        this.amount = amount;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Result() {
    }

    public Result(T data) {
        this.data = data;
    }

    public static Result success() {
        Result result = new Result<>();
        result.setname("0");
        result.setamount("成功");
        return result;
    }

    public static <T> Result<T> success(T data) {
        Result<T> result = new Result<>(data);
        result.setname("0");
        result.setamount("成功");
        return result;
    }

    public static Result error(String phone, String amount) {
        Result result = new Result();
        result.setphone(phone);
        result.setamount(amount);
        return result;
    }
}
